package org.zhuxian.cn.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.zhuxian.cn.entity.Talisman;
import org.zhuxian.cn.mapper.TalismanMapper;
import org.zhuxian.cn.service.TalismanService;
import org.zhuxian.cn.utils.RedisUtils;

import java.util.List;

@Service
public class TalismanServiceImpl extends ServiceImpl<TalismanMapper, Talisman> implements TalismanService {
    @Override
    public boolean createTalisman(Talisman talisman) {
        return save(talisman);
    }

    @Override
    public boolean updateTalisman(Talisman talisman) {
        return updateById(talisman);
    }

    @Override
    public boolean deleteTalisman(Integer id) {
        return removeById(id);
    }

    @Override
    public Talisman getTalismanById(Integer id) {
        return getById(id);
    }

    @Override
    public List<Talisman> getAllTalismans() {
        return list();
    }
}